<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	processNm	= Request("findProcess")

	
	SQLTitle = "-- ■■■■ 단위공정 관리 그리드 List up ■■■■"
	
	'## 검색조건에 따른 조건절 만들기 
	If processNm <> "" Then 
		addSql = " A.processNm LIKE '%" & processNm & "%' "
	End If 
	If addSql <> "" Then 
		addSql = " WHERE " & addSql 
	End If 

	SQL = "SELECT A.processCd, A.processNm, A.working, A.execTime, A.type, A.flag, B.itemNm FROM tblUnitProcess A LEFT JOIN (SELECT itemCd, itemNm FROM tblComCode WHERE groupCd='0004' AND flag='Y') B ON A.type=B.itemCd " & addSql & " ORDER BY flag DESC, processNm" 

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<Process>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
			Response.write "	<ProcList>" & vbcrlf
				Call mkXMLNode("processCd", rs("processCd"), 2)
				Call mkXMLNode("processNm", rs("processNm"), 2)
				Call mkXMLNode("working", rs("working"), 2)
				Call mkXMLNode("execTime", rs("execTime"), 2)
				Call mkXMLNode("type", rs("type"), 2)
				Call mkXMLNode("flag", Rs("flag"), 2)
				Call mkXMLNode("itemNm", Rs("itemNm"), 2)
			Response.write "	</ProcList>" & vbcrlf

		Rs.movenext
		Loop 
	End If
	Response.write "</Process>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>